package cn.ibizlab.odoo.core.odoo_base.service.impl;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.math.BigInteger;
import java.util.Collection;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import cn.ibizlab.odoo.core.client.model.Ires_company;
import cn.ibizlab.odoo.core.odoo_base.domain.Res_company;
import cn.ibizlab.odoo.core.odoo_base.filter.Res_companySearchContext;
import cn.ibizlab.odoo.core.odoo_base.service.IRes_companyService;
import cn.ibizlab.odoo.util.SearchResult;
import cn.ibizlab.odoo.util.log.IBIZLog;

/**
 * 实体[公司] 服务对象接口实现
 */
@Slf4j
@IBIZLog
@Service
public class Res_companyServiceImpl implements IRes_companyService {

    @Autowired
    private cn.ibizlab.odoo.core.client.service.Ires_companyClientService res_companyClientService;

    @Override
    public Res_company get(Integer id) {
        Ires_company clientModel = res_companyClientService.createModel();
        clientModel.setId(id);
        res_companyClientService.get(clientModel) ;
        return this.convert2Domain(clientModel,null);
    }

    @Override
    public Res_company get(Res_company res_company) {
        Res_company retres_company = this.get(res_company.getId()) ;
    	BeanCopier copier=BeanCopier.create(retres_company.getClass(), res_company.getClass(), false);
        copier.copy(retres_company, res_company, null);
        return res_company ;
    }

    @Override
    public boolean remove(Integer id) {
        boolean bOk = false ;
        Ires_company clientModel = res_companyClientService.createModel();
        clientModel.setId(id);
        res_companyClientService.remove(clientModel) ;
        bOk = true ;
        return bOk ;
    }

    @Override
    public void createBatch(List<Res_company> res_companys, int batchSize) {

                        //res_companyClientService.createBatch(res_companys,batchSize) ;

    }

    @Override
    public void updateBatch(List<Res_company> res_companys, int batchSize) {

        //res_companyClientService.updateBatch(res_companys,batchSize) ;

    }

    @Override
    public boolean create(Res_company res_company) {
        boolean bOk = false ;
        Ires_company clientModel = this.convert2Model(res_company,null);
        res_companyClientService.create(clientModel) ;
        this.convert2Domain(clientModel,res_company);
        bOk = true ;

        return bOk ;
    }

    @Override
    public boolean update(Res_company res_company) {
        boolean bOk = false ;
        Ires_company clientModel = this.convert2Model(res_company,null);
        res_companyClientService.update(clientModel) ;
        this.convert2Domain(clientModel,res_company) ;
        bOk = true;
        return bOk ;
    }

    @Override
    public void removeBatch(Collection<? extends Serializable> idList, int batchSize) {

        //res_companyClientService.removeBatch(res_companys) ;

    }

    /**
     * 查询集合 默认查询
     */
    @Override
    public Page<Res_company> searchDefault(Res_companySearchContext context) {
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());
    }


    /**
     * 根据科目查询
     */
    @Override
    public Page<Res_company> selectByOdoo_property_stock_account_input_categ(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据科目查询
     */
    @Override
    public Page<Res_company> selectByOdoo_property_stock_account_output_categ(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据科目查询
     */
    @Override
    public Page<Res_company> selectByOdoo_property_stock_valuation_account(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据科目查询
     */
    @Override
    public Page<Res_company> selectByOdoo_transfer_account(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据科目表模版查询
     */
    @Override
    public Page<Res_company> selectByOdoo_chart_template(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据贸易条款查询
     */
    @Override
    public Page<Res_company> selectByOdoo_incoterm(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据日记账查询
     */
    @Override
    public Page<Res_company> selectByOdoo_currency_exchange_journal(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据日记账查询
     */
    @Override
    public Page<Res_company> selectByOdoo_tax_cash_basis_journal(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据凭证录入查询
     */
    @Override
    public Page<Res_company> selectByOdoo_account_opening_move(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据税率查询
     */
    @Override
    public Page<Res_company> selectByOdoo_account_purchase_tax(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据税率查询
     */
    @Override
    public Page<Res_company> selectByOdoo_account_sale_tax(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据资源工作时间查询
     */
    @Override
    public Page<Res_company> selectByOdoo_resource_calendar(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据公司查询
     */
    @Override
    public Page<Res_company> selectByOdoo_parent(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据币种查询
     */
    @Override
    public Page<Res_company> selectByOdoo_currency(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据联系人查询
     */
    @Override
    public Page<Res_company> selectByOdoo_partner(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Res_company> selectByOdoo_create(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Res_company> selectByOdoo_write(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存位置查询
     */
    @Override
    public Page<Res_company> selectByOdoo_internal_transit_location(Integer id){
        Res_companySearchContext context = new Res_companySearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Res_company> list = new ArrayList<Res_company>();
        Page<cn.ibizlab.odoo.core.client.model.Ires_company> clientModelList = res_companyClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Ires_company clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Res_company>(list, context.getPageable(), clientModelList.getTotalElements());

    }



    public Ires_company convert2Model(Res_company domain , Ires_company model) {
        if(domain == null)
            return model ;
        if(model==null){
            model = res_companyClientService.createModel() ;
        }

         if(domain.getReport_headerDirtyFlag())
            model.setReport_header(domain.getReport_header());
         if(domain.getCountry_idDirtyFlag())
            model.setCountry_id(domain.getCountry_id());
         if(domain.getSale_quotation_onboarding_stateDirtyFlag())
            model.setSale_quotation_onboarding_state(domain.getSale_quotation_onboarding_state());
         if(domain.getQuotation_validity_daysDirtyFlag())
            model.setQuotation_validity_days(domain.getQuotation_validity_days());
         if(domain.getAccount_onboarding_invoice_layout_stateDirtyFlag())
            model.setAccount_onboarding_invoice_layout_state(domain.getAccount_onboarding_invoice_layout_state());
         if(domain.getAccount_noDirtyFlag())
            model.setAccount_no(domain.getAccount_no());
         if(domain.getBank_account_code_prefixDirtyFlag())
            model.setBank_account_code_prefix(domain.getBank_account_code_prefix());
         if(domain.getBank_journal_idsDirtyFlag())
            model.setBank_journal_ids(domain.getBank_journal_ids());
         if(domain.getZipDirtyFlag())
            model.setZip(domain.getZip());
         if(domain.getPeriod_lock_dateDirtyFlag())
            model.setPeriod_lock_date(domain.getPeriod_lock_date());
         if(domain.getState_idDirtyFlag())
            model.setState_id(domain.getState_id());
         if(domain.getTax_exigibilityDirtyFlag())
            model.setTax_exigibility(domain.getTax_exigibility());
         if(domain.getResource_calendar_idsDirtyFlag())
            model.setResource_calendar_ids(domain.getResource_calendar_ids());
         if(domain.getBank_idsDirtyFlag())
            model.setBank_ids(domain.getBank_ids());
         if(domain.getAccount_dashboard_onboarding_stateDirtyFlag())
            model.setAccount_dashboard_onboarding_state(domain.getAccount_dashboard_onboarding_state());
         if(domain.getPropagation_minimum_deltaDirtyFlag())
            model.setPropagation_minimum_delta(domain.getPropagation_minimum_delta());
         if(domain.getCreate_dateDirtyFlag())
            model.setCreate_date(domain.getCreate_date());
         if(domain.getSnailmail_colorDirtyFlag())
            model.setSnailmail_color(domain.getSnailmail_color());
         if(domain.getOverdue_msgDirtyFlag())
            model.setOverdue_msg(domain.getOverdue_msg());
         if(domain.getCityDirtyFlag())
            model.setCity(domain.getCity());
         if(domain.getAccount_setup_coa_stateDirtyFlag())
            model.setAccount_setup_coa_state(domain.getAccount_setup_coa_state());
         if(domain.getInvoice_reference_typeDirtyFlag())
            model.setInvoice_reference_type(domain.getInvoice_reference_type());
         if(domain.getCatchallDirtyFlag())
            model.setCatchall(domain.getCatchall());
         if(domain.getDisplay_nameDirtyFlag())
            model.setDisplay_name(domain.getDisplay_name());
         if(domain.getAnglo_saxon_accountingDirtyFlag())
            model.setAnglo_saxon_accounting(domain.getAnglo_saxon_accounting());
         if(domain.getSnailmail_duplexDirtyFlag())
            model.setSnailmail_duplex(domain.getSnailmail_duplex());
         if(domain.getSocial_githubDirtyFlag())
            model.setSocial_github(domain.getSocial_github());
         if(domain.getAccount_setup_bank_data_stateDirtyFlag())
            model.setAccount_setup_bank_data_state(domain.getAccount_setup_bank_data_state());
         if(domain.getIdDirtyFlag())
            model.setId(domain.getId());
         if(domain.getStreet2DirtyFlag())
            model.setStreet2(domain.getStreet2());
         if(domain.getExpects_chart_of_accountsDirtyFlag())
            model.setExpects_chart_of_accounts(domain.getExpects_chart_of_accounts());
         if(domain.getTransfer_account_code_prefixDirtyFlag())
            model.setTransfer_account_code_prefix(domain.getTransfer_account_code_prefix());
         if(domain.getFiscalyear_last_dayDirtyFlag())
            model.setFiscalyear_last_day(domain.getFiscalyear_last_day());
         if(domain.getUser_idsDirtyFlag())
            model.setUser_ids(domain.getUser_ids());
         if(domain.getAccount_bank_reconciliation_startDirtyFlag())
            model.setAccount_bank_reconciliation_start(domain.getAccount_bank_reconciliation_start());
         if(domain.getPortal_confirmation_payDirtyFlag())
            model.setPortal_confirmation_pay(domain.getPortal_confirmation_pay());
         if(domain.getQr_codeDirtyFlag())
            model.setQr_code(domain.getQr_code());
         if(domain.getStreetDirtyFlag())
            model.setStreet(domain.getStreet());
         if(domain.getAccount_invoice_onboarding_stateDirtyFlag())
            model.setAccount_invoice_onboarding_state(domain.getAccount_invoice_onboarding_state());
         if(domain.getChild_idsDirtyFlag())
            model.setChild_ids(domain.getChild_ids());
         if(domain.getSequenceDirtyFlag())
            model.setSequence(domain.getSequence());
         if(domain.getNomenclature_idDirtyFlag())
            model.setNomenclature_id(domain.getNomenclature_id());
         if(domain.getSocial_googleplusDirtyFlag())
            model.setSocial_googleplus(domain.getSocial_googleplus());
         if(domain.getPayment_acquirer_onboarding_stateDirtyFlag())
            model.setPayment_acquirer_onboarding_state(domain.getPayment_acquirer_onboarding_state());
         if(domain.getReport_footerDirtyFlag())
            model.setReport_footer(domain.getReport_footer());
         if(domain.getPayment_onboarding_payment_methodDirtyFlag())
            model.setPayment_onboarding_payment_method(domain.getPayment_onboarding_payment_method());
         if(domain.getWrite_dateDirtyFlag())
            model.setWrite_date(domain.getWrite_date());
         if(domain.getPo_double_validationDirtyFlag())
            model.setPo_double_validation(domain.getPo_double_validation());
         if(domain.getPo_leadDirtyFlag())
            model.setPo_lead(domain.getPo_lead());
         if(domain.getSale_onboarding_sample_quotation_stateDirtyFlag())
            model.setSale_onboarding_sample_quotation_state(domain.getSale_onboarding_sample_quotation_state());
         if(domain.getSale_onboarding_order_confirmation_stateDirtyFlag())
            model.setSale_onboarding_order_confirmation_state(domain.getSale_onboarding_order_confirmation_state());
         if(domain.getExternal_report_layout_idDirtyFlag())
            model.setExternal_report_layout_id(domain.getExternal_report_layout_id());
         if(domain.getSale_onboarding_payment_methodDirtyFlag())
            model.setSale_onboarding_payment_method(domain.getSale_onboarding_payment_method());
         if(domain.getAccount_onboarding_sample_invoice_stateDirtyFlag())
            model.setAccount_onboarding_sample_invoice_state(domain.getAccount_onboarding_sample_invoice_state());
         if(domain.getBase_onboarding_company_stateDirtyFlag())
            model.setBase_onboarding_company_state(domain.getBase_onboarding_company_state());
         if(domain.getSocial_linkedinDirtyFlag())
            model.setSocial_linkedin(domain.getSocial_linkedin());
         if(domain.getManufacturing_leadDirtyFlag())
            model.setManufacturing_lead(domain.getManufacturing_lead());
         if(domain.getSale_noteDirtyFlag())
            model.setSale_note(domain.getSale_note());
         if(domain.getPo_double_validation_amountDirtyFlag())
            model.setPo_double_validation_amount(domain.getPo_double_validation_amount());
         if(domain.getPo_lockDirtyFlag())
            model.setPo_lock(domain.getPo_lock());
         if(domain.getSocial_twitterDirtyFlag())
            model.setSocial_twitter(domain.getSocial_twitter());
         if(domain.getSocial_instagramDirtyFlag())
            model.setSocial_instagram(domain.getSocial_instagram());
         if(domain.getAccount_setup_fy_data_stateDirtyFlag())
            model.setAccount_setup_fy_data_state(domain.getAccount_setup_fy_data_state());
         if(domain.getTax_calculation_rounding_methodDirtyFlag())
            model.setTax_calculation_rounding_method(domain.getTax_calculation_rounding_method());
         if(domain.getCash_account_code_prefixDirtyFlag())
            model.setCash_account_code_prefix(domain.getCash_account_code_prefix());
         if(domain.getAccount_onboarding_sale_tax_stateDirtyFlag())
            model.setAccount_onboarding_sale_tax_state(domain.getAccount_onboarding_sale_tax_state());
         if(domain.getSecurity_leadDirtyFlag())
            model.setSecurity_lead(domain.getSecurity_lead());
         if(domain.getWebsite_theme_onboarding_doneDirtyFlag())
            model.setWebsite_theme_onboarding_done(domain.getWebsite_theme_onboarding_done());
         if(domain.getInvoice_is_printDirtyFlag())
            model.setInvoice_is_print(domain.getInvoice_is_print());
         if(domain.getCompany_registryDirtyFlag())
            model.setCompany_registry(domain.getCompany_registry());
         if(domain.get__last_updateDirtyFlag())
            model.set__last_update(domain.get__last_update());
         if(domain.getLogo_webDirtyFlag())
            model.setLogo_web(domain.getLogo_web());
         if(domain.getFiscalyear_lock_dateDirtyFlag())
            model.setFiscalyear_lock_date(domain.getFiscalyear_lock_date());
         if(domain.getInvoice_is_snailmailDirtyFlag())
            model.setInvoice_is_snailmail(domain.getInvoice_is_snailmail());
         if(domain.getWebsite_sale_onboarding_payment_acquirer_stateDirtyFlag())
            model.setWebsite_sale_onboarding_payment_acquirer_state(domain.getWebsite_sale_onboarding_payment_acquirer_state());
         if(domain.getSocial_facebookDirtyFlag())
            model.setSocial_facebook(domain.getSocial_facebook());
         if(domain.getPortal_confirmation_signDirtyFlag())
            model.setPortal_confirmation_sign(domain.getPortal_confirmation_sign());
         if(domain.getPaperformat_idDirtyFlag())
            model.setPaperformat_id(domain.getPaperformat_id());
         if(domain.getFiscalyear_last_monthDirtyFlag())
            model.setFiscalyear_last_month(domain.getFiscalyear_last_month());
         if(domain.getInvoice_is_emailDirtyFlag())
            model.setInvoice_is_email(domain.getInvoice_is_email());
         if(domain.getSocial_youtubeDirtyFlag())
            model.setSocial_youtube(domain.getSocial_youtube());
         if(domain.getExpense_currency_exchange_account_idDirtyFlag())
            model.setExpense_currency_exchange_account_id(domain.getExpense_currency_exchange_account_id());
         if(domain.getPartner_gidDirtyFlag())
            model.setPartner_gid(domain.getPartner_gid());
         if(domain.getPhoneDirtyFlag())
            model.setPhone(domain.getPhone());
         if(domain.getLogoDirtyFlag())
            model.setLogo(domain.getLogo());
         if(domain.getProperty_stock_account_input_categ_id_textDirtyFlag())
            model.setProperty_stock_account_input_categ_id_text(domain.getProperty_stock_account_input_categ_id_text());
         if(domain.getAccount_purchase_tax_id_textDirtyFlag())
            model.setAccount_purchase_tax_id_text(domain.getAccount_purchase_tax_id_text());
         if(domain.getNameDirtyFlag())
            model.setName(domain.getName());
         if(domain.getIncoterm_id_textDirtyFlag())
            model.setIncoterm_id_text(domain.getIncoterm_id_text());
         if(domain.getAccount_opening_journal_idDirtyFlag())
            model.setAccount_opening_journal_id(domain.getAccount_opening_journal_id());
         if(domain.getTransfer_account_id_textDirtyFlag())
            model.setTransfer_account_id_text(domain.getTransfer_account_id_text());
         if(domain.getIncome_currency_exchange_account_idDirtyFlag())
            model.setIncome_currency_exchange_account_id(domain.getIncome_currency_exchange_account_id());
         if(domain.getCurrency_id_textDirtyFlag())
            model.setCurrency_id_text(domain.getCurrency_id_text());
         if(domain.getAccount_opening_dateDirtyFlag())
            model.setAccount_opening_date(domain.getAccount_opening_date());
         if(domain.getWrite_uid_textDirtyFlag())
            model.setWrite_uid_text(domain.getWrite_uid_text());
         if(domain.getChart_template_id_textDirtyFlag())
            model.setChart_template_id_text(domain.getChart_template_id_text());
         if(domain.getAccount_sale_tax_id_textDirtyFlag())
            model.setAccount_sale_tax_id_text(domain.getAccount_sale_tax_id_text());
         if(domain.getAccount_opening_move_id_textDirtyFlag())
            model.setAccount_opening_move_id_text(domain.getAccount_opening_move_id_text());
         if(domain.getEmailDirtyFlag())
            model.setEmail(domain.getEmail());
         if(domain.getCreate_uid_textDirtyFlag())
            model.setCreate_uid_text(domain.getCreate_uid_text());
         if(domain.getProperty_stock_account_output_categ_id_textDirtyFlag())
            model.setProperty_stock_account_output_categ_id_text(domain.getProperty_stock_account_output_categ_id_text());
         if(domain.getProperty_stock_valuation_account_id_textDirtyFlag())
            model.setProperty_stock_valuation_account_id_text(domain.getProperty_stock_valuation_account_id_text());
         if(domain.getParent_id_textDirtyFlag())
            model.setParent_id_text(domain.getParent_id_text());
         if(domain.getTax_cash_basis_journal_id_textDirtyFlag())
            model.setTax_cash_basis_journal_id_text(domain.getTax_cash_basis_journal_id_text());
         if(domain.getInternal_transit_location_id_textDirtyFlag())
            model.setInternal_transit_location_id_text(domain.getInternal_transit_location_id_text());
         if(domain.getWebsiteDirtyFlag())
            model.setWebsite(domain.getWebsite());
         if(domain.getVatDirtyFlag())
            model.setVat(domain.getVat());
         if(domain.getResource_calendar_id_textDirtyFlag())
            model.setResource_calendar_id_text(domain.getResource_calendar_id_text());
         if(domain.getCurrency_exchange_journal_id_textDirtyFlag())
            model.setCurrency_exchange_journal_id_text(domain.getCurrency_exchange_journal_id_text());
         if(domain.getCreate_uidDirtyFlag())
            model.setCreate_uid(domain.getCreate_uid());
         if(domain.getParent_idDirtyFlag())
            model.setParent_id(domain.getParent_id());
         if(domain.getCurrency_idDirtyFlag())
            model.setCurrency_id(domain.getCurrency_id());
         if(domain.getWrite_uidDirtyFlag())
            model.setWrite_uid(domain.getWrite_uid());
         if(domain.getProperty_stock_account_output_categ_idDirtyFlag())
            model.setProperty_stock_account_output_categ_id(domain.getProperty_stock_account_output_categ_id());
         if(domain.getProperty_stock_valuation_account_idDirtyFlag())
            model.setProperty_stock_valuation_account_id(domain.getProperty_stock_valuation_account_id());
         if(domain.getAccount_opening_move_idDirtyFlag())
            model.setAccount_opening_move_id(domain.getAccount_opening_move_id());
         if(domain.getInternal_transit_location_idDirtyFlag())
            model.setInternal_transit_location_id(domain.getInternal_transit_location_id());
         if(domain.getAccount_purchase_tax_idDirtyFlag())
            model.setAccount_purchase_tax_id(domain.getAccount_purchase_tax_id());
         if(domain.getChart_template_idDirtyFlag())
            model.setChart_template_id(domain.getChart_template_id());
         if(domain.getAccount_sale_tax_idDirtyFlag())
            model.setAccount_sale_tax_id(domain.getAccount_sale_tax_id());
         if(domain.getTax_cash_basis_journal_idDirtyFlag())
            model.setTax_cash_basis_journal_id(domain.getTax_cash_basis_journal_id());
         if(domain.getProperty_stock_account_input_categ_idDirtyFlag())
            model.setProperty_stock_account_input_categ_id(domain.getProperty_stock_account_input_categ_id());
         if(domain.getPartner_idDirtyFlag())
            model.setPartner_id(domain.getPartner_id());
         if(domain.getIncoterm_idDirtyFlag())
            model.setIncoterm_id(domain.getIncoterm_id());
         if(domain.getResource_calendar_idDirtyFlag())
            model.setResource_calendar_id(domain.getResource_calendar_id());
         if(domain.getTransfer_account_idDirtyFlag())
            model.setTransfer_account_id(domain.getTransfer_account_id());
         if(domain.getCurrency_exchange_journal_idDirtyFlag())
            model.setCurrency_exchange_journal_id(domain.getCurrency_exchange_journal_id());
        return model ;
    }

    public Res_company convert2Domain( Ires_company model ,Res_company domain) {
        if(model == null)
            return domain ;
        if(domain == null){
            domain = new Res_company();
        }

        if(model.getReport_headerDirtyFlag())
            domain.setReport_header(model.getReport_header());
        if(model.getCountry_idDirtyFlag())
            domain.setCountry_id(model.getCountry_id());
        if(model.getSale_quotation_onboarding_stateDirtyFlag())
            domain.setSale_quotation_onboarding_state(model.getSale_quotation_onboarding_state());
        if(model.getQuotation_validity_daysDirtyFlag())
            domain.setQuotation_validity_days(model.getQuotation_validity_days());
        if(model.getAccount_onboarding_invoice_layout_stateDirtyFlag())
            domain.setAccount_onboarding_invoice_layout_state(model.getAccount_onboarding_invoice_layout_state());
        if(model.getAccount_noDirtyFlag())
            domain.setAccount_no(model.getAccount_no());
        if(model.getBank_account_code_prefixDirtyFlag())
            domain.setBank_account_code_prefix(model.getBank_account_code_prefix());
        if(model.getBank_journal_idsDirtyFlag())
            domain.setBank_journal_ids(model.getBank_journal_ids());
        if(model.getZipDirtyFlag())
            domain.setZip(model.getZip());
        if(model.getPeriod_lock_dateDirtyFlag())
            domain.setPeriod_lock_date(model.getPeriod_lock_date());
        if(model.getState_idDirtyFlag())
            domain.setState_id(model.getState_id());
        if(model.getTax_exigibilityDirtyFlag())
            domain.setTax_exigibility(model.getTax_exigibility());
        if(model.getResource_calendar_idsDirtyFlag())
            domain.setResource_calendar_ids(model.getResource_calendar_ids());
        if(model.getBank_idsDirtyFlag())
            domain.setBank_ids(model.getBank_ids());
        if(model.getAccount_dashboard_onboarding_stateDirtyFlag())
            domain.setAccount_dashboard_onboarding_state(model.getAccount_dashboard_onboarding_state());
        if(model.getPropagation_minimum_deltaDirtyFlag())
            domain.setPropagation_minimum_delta(model.getPropagation_minimum_delta());
        if(model.getCreate_dateDirtyFlag())
            domain.setCreate_date(model.getCreate_date());
        if(model.getSnailmail_colorDirtyFlag())
            domain.setSnailmail_color(model.getSnailmail_color());
        if(model.getOverdue_msgDirtyFlag())
            domain.setOverdue_msg(model.getOverdue_msg());
        if(model.getCityDirtyFlag())
            domain.setCity(model.getCity());
        if(model.getAccount_setup_coa_stateDirtyFlag())
            domain.setAccount_setup_coa_state(model.getAccount_setup_coa_state());
        if(model.getInvoice_reference_typeDirtyFlag())
            domain.setInvoice_reference_type(model.getInvoice_reference_type());
        if(model.getCatchallDirtyFlag())
            domain.setCatchall(model.getCatchall());
        if(model.getDisplay_nameDirtyFlag())
            domain.setDisplay_name(model.getDisplay_name());
        if(model.getAnglo_saxon_accountingDirtyFlag())
            domain.setAnglo_saxon_accounting(model.getAnglo_saxon_accounting());
        if(model.getSnailmail_duplexDirtyFlag())
            domain.setSnailmail_duplex(model.getSnailmail_duplex());
        if(model.getSocial_githubDirtyFlag())
            domain.setSocial_github(model.getSocial_github());
        if(model.getAccount_setup_bank_data_stateDirtyFlag())
            domain.setAccount_setup_bank_data_state(model.getAccount_setup_bank_data_state());
        if(model.getIdDirtyFlag())
            domain.setId(model.getId());
        if(model.getStreet2DirtyFlag())
            domain.setStreet2(model.getStreet2());
        if(model.getExpects_chart_of_accountsDirtyFlag())
            domain.setExpects_chart_of_accounts(model.getExpects_chart_of_accounts());
        if(model.getTransfer_account_code_prefixDirtyFlag())
            domain.setTransfer_account_code_prefix(model.getTransfer_account_code_prefix());
        if(model.getFiscalyear_last_dayDirtyFlag())
            domain.setFiscalyear_last_day(model.getFiscalyear_last_day());
        if(model.getUser_idsDirtyFlag())
            domain.setUser_ids(model.getUser_ids());
        if(model.getAccount_bank_reconciliation_startDirtyFlag())
            domain.setAccount_bank_reconciliation_start(model.getAccount_bank_reconciliation_start());
        if(model.getPortal_confirmation_payDirtyFlag())
            domain.setPortal_confirmation_pay(model.getPortal_confirmation_pay());
        if(model.getQr_codeDirtyFlag())
            domain.setQr_code(model.getQr_code());
        if(model.getStreetDirtyFlag())
            domain.setStreet(model.getStreet());
        if(model.getAccount_invoice_onboarding_stateDirtyFlag())
            domain.setAccount_invoice_onboarding_state(model.getAccount_invoice_onboarding_state());
        if(model.getChild_idsDirtyFlag())
            domain.setChild_ids(model.getChild_ids());
        if(model.getSequenceDirtyFlag())
            domain.setSequence(model.getSequence());
        if(model.getNomenclature_idDirtyFlag())
            domain.setNomenclature_id(model.getNomenclature_id());
        if(model.getSocial_googleplusDirtyFlag())
            domain.setSocial_googleplus(model.getSocial_googleplus());
        if(model.getPayment_acquirer_onboarding_stateDirtyFlag())
            domain.setPayment_acquirer_onboarding_state(model.getPayment_acquirer_onboarding_state());
        if(model.getReport_footerDirtyFlag())
            domain.setReport_footer(model.getReport_footer());
        if(model.getPayment_onboarding_payment_methodDirtyFlag())
            domain.setPayment_onboarding_payment_method(model.getPayment_onboarding_payment_method());
        if(model.getWrite_dateDirtyFlag())
            domain.setWrite_date(model.getWrite_date());
        if(model.getPo_double_validationDirtyFlag())
            domain.setPo_double_validation(model.getPo_double_validation());
        if(model.getPo_leadDirtyFlag())
            domain.setPo_lead(model.getPo_lead());
        if(model.getSale_onboarding_sample_quotation_stateDirtyFlag())
            domain.setSale_onboarding_sample_quotation_state(model.getSale_onboarding_sample_quotation_state());
        if(model.getSale_onboarding_order_confirmation_stateDirtyFlag())
            domain.setSale_onboarding_order_confirmation_state(model.getSale_onboarding_order_confirmation_state());
        if(model.getExternal_report_layout_idDirtyFlag())
            domain.setExternal_report_layout_id(model.getExternal_report_layout_id());
        if(model.getSale_onboarding_payment_methodDirtyFlag())
            domain.setSale_onboarding_payment_method(model.getSale_onboarding_payment_method());
        if(model.getAccount_onboarding_sample_invoice_stateDirtyFlag())
            domain.setAccount_onboarding_sample_invoice_state(model.getAccount_onboarding_sample_invoice_state());
        if(model.getBase_onboarding_company_stateDirtyFlag())
            domain.setBase_onboarding_company_state(model.getBase_onboarding_company_state());
        if(model.getSocial_linkedinDirtyFlag())
            domain.setSocial_linkedin(model.getSocial_linkedin());
        if(model.getManufacturing_leadDirtyFlag())
            domain.setManufacturing_lead(model.getManufacturing_lead());
        if(model.getSale_noteDirtyFlag())
            domain.setSale_note(model.getSale_note());
        if(model.getPo_double_validation_amountDirtyFlag())
            domain.setPo_double_validation_amount(model.getPo_double_validation_amount());
        if(model.getPo_lockDirtyFlag())
            domain.setPo_lock(model.getPo_lock());
        if(model.getSocial_twitterDirtyFlag())
            domain.setSocial_twitter(model.getSocial_twitter());
        if(model.getSocial_instagramDirtyFlag())
            domain.setSocial_instagram(model.getSocial_instagram());
        if(model.getAccount_setup_fy_data_stateDirtyFlag())
            domain.setAccount_setup_fy_data_state(model.getAccount_setup_fy_data_state());
        if(model.getTax_calculation_rounding_methodDirtyFlag())
            domain.setTax_calculation_rounding_method(model.getTax_calculation_rounding_method());
        if(model.getCash_account_code_prefixDirtyFlag())
            domain.setCash_account_code_prefix(model.getCash_account_code_prefix());
        if(model.getAccount_onboarding_sale_tax_stateDirtyFlag())
            domain.setAccount_onboarding_sale_tax_state(model.getAccount_onboarding_sale_tax_state());
        if(model.getSecurity_leadDirtyFlag())
            domain.setSecurity_lead(model.getSecurity_lead());
        if(model.getWebsite_theme_onboarding_doneDirtyFlag())
            domain.setWebsite_theme_onboarding_done(model.getWebsite_theme_onboarding_done());
        if(model.getInvoice_is_printDirtyFlag())
            domain.setInvoice_is_print(model.getInvoice_is_print());
        if(model.getCompany_registryDirtyFlag())
            domain.setCompany_registry(model.getCompany_registry());
        if(model.get__last_updateDirtyFlag())
            domain.set__last_update(model.get__last_update());
        if(model.getLogo_webDirtyFlag())
            domain.setLogo_web(model.getLogo_web());
        if(model.getFiscalyear_lock_dateDirtyFlag())
            domain.setFiscalyear_lock_date(model.getFiscalyear_lock_date());
        if(model.getInvoice_is_snailmailDirtyFlag())
            domain.setInvoice_is_snailmail(model.getInvoice_is_snailmail());
        if(model.getWebsite_sale_onboarding_payment_acquirer_stateDirtyFlag())
            domain.setWebsite_sale_onboarding_payment_acquirer_state(model.getWebsite_sale_onboarding_payment_acquirer_state());
        if(model.getSocial_facebookDirtyFlag())
            domain.setSocial_facebook(model.getSocial_facebook());
        if(model.getPortal_confirmation_signDirtyFlag())
            domain.setPortal_confirmation_sign(model.getPortal_confirmation_sign());
        if(model.getPaperformat_idDirtyFlag())
            domain.setPaperformat_id(model.getPaperformat_id());
        if(model.getFiscalyear_last_monthDirtyFlag())
            domain.setFiscalyear_last_month(model.getFiscalyear_last_month());
        if(model.getInvoice_is_emailDirtyFlag())
            domain.setInvoice_is_email(model.getInvoice_is_email());
        if(model.getSocial_youtubeDirtyFlag())
            domain.setSocial_youtube(model.getSocial_youtube());
        if(model.getExpense_currency_exchange_account_idDirtyFlag())
            domain.setExpense_currency_exchange_account_id(model.getExpense_currency_exchange_account_id());
        if(model.getPartner_gidDirtyFlag())
            domain.setPartner_gid(model.getPartner_gid());
        if(model.getPhoneDirtyFlag())
            domain.setPhone(model.getPhone());
        if(model.getLogoDirtyFlag())
            domain.setLogo(model.getLogo());
        if(model.getProperty_stock_account_input_categ_id_textDirtyFlag())
            domain.setProperty_stock_account_input_categ_id_text(model.getProperty_stock_account_input_categ_id_text());
        if(model.getAccount_purchase_tax_id_textDirtyFlag())
            domain.setAccount_purchase_tax_id_text(model.getAccount_purchase_tax_id_text());
        if(model.getNameDirtyFlag())
            domain.setName(model.getName());
        if(model.getIncoterm_id_textDirtyFlag())
            domain.setIncoterm_id_text(model.getIncoterm_id_text());
        if(model.getAccount_opening_journal_idDirtyFlag())
            domain.setAccount_opening_journal_id(model.getAccount_opening_journal_id());
        if(model.getTransfer_account_id_textDirtyFlag())
            domain.setTransfer_account_id_text(model.getTransfer_account_id_text());
        if(model.getIncome_currency_exchange_account_idDirtyFlag())
            domain.setIncome_currency_exchange_account_id(model.getIncome_currency_exchange_account_id());
        if(model.getCurrency_id_textDirtyFlag())
            domain.setCurrency_id_text(model.getCurrency_id_text());
        if(model.getAccount_opening_dateDirtyFlag())
            domain.setAccount_opening_date(model.getAccount_opening_date());
        if(model.getWrite_uid_textDirtyFlag())
            domain.setWrite_uid_text(model.getWrite_uid_text());
        if(model.getChart_template_id_textDirtyFlag())
            domain.setChart_template_id_text(model.getChart_template_id_text());
        if(model.getAccount_sale_tax_id_textDirtyFlag())
            domain.setAccount_sale_tax_id_text(model.getAccount_sale_tax_id_text());
        if(model.getAccount_opening_move_id_textDirtyFlag())
            domain.setAccount_opening_move_id_text(model.getAccount_opening_move_id_text());
        if(model.getEmailDirtyFlag())
            domain.setEmail(model.getEmail());
        if(model.getCreate_uid_textDirtyFlag())
            domain.setCreate_uid_text(model.getCreate_uid_text());
        if(model.getProperty_stock_account_output_categ_id_textDirtyFlag())
            domain.setProperty_stock_account_output_categ_id_text(model.getProperty_stock_account_output_categ_id_text());
        if(model.getProperty_stock_valuation_account_id_textDirtyFlag())
            domain.setProperty_stock_valuation_account_id_text(model.getProperty_stock_valuation_account_id_text());
        if(model.getParent_id_textDirtyFlag())
            domain.setParent_id_text(model.getParent_id_text());
        if(model.getTax_cash_basis_journal_id_textDirtyFlag())
            domain.setTax_cash_basis_journal_id_text(model.getTax_cash_basis_journal_id_text());
        if(model.getInternal_transit_location_id_textDirtyFlag())
            domain.setInternal_transit_location_id_text(model.getInternal_transit_location_id_text());
        if(model.getWebsiteDirtyFlag())
            domain.setWebsite(model.getWebsite());
        if(model.getVatDirtyFlag())
            domain.setVat(model.getVat());
        if(model.getResource_calendar_id_textDirtyFlag())
            domain.setResource_calendar_id_text(model.getResource_calendar_id_text());
        if(model.getCurrency_exchange_journal_id_textDirtyFlag())
            domain.setCurrency_exchange_journal_id_text(model.getCurrency_exchange_journal_id_text());
        if(model.getCreate_uidDirtyFlag())
            domain.setCreate_uid(model.getCreate_uid());
        if(model.getParent_idDirtyFlag())
            domain.setParent_id(model.getParent_id());
        if(model.getCurrency_idDirtyFlag())
            domain.setCurrency_id(model.getCurrency_id());
        if(model.getWrite_uidDirtyFlag())
            domain.setWrite_uid(model.getWrite_uid());
        if(model.getProperty_stock_account_output_categ_idDirtyFlag())
            domain.setProperty_stock_account_output_categ_id(model.getProperty_stock_account_output_categ_id());
        if(model.getProperty_stock_valuation_account_idDirtyFlag())
            domain.setProperty_stock_valuation_account_id(model.getProperty_stock_valuation_account_id());
        if(model.getAccount_opening_move_idDirtyFlag())
            domain.setAccount_opening_move_id(model.getAccount_opening_move_id());
        if(model.getInternal_transit_location_idDirtyFlag())
            domain.setInternal_transit_location_id(model.getInternal_transit_location_id());
        if(model.getAccount_purchase_tax_idDirtyFlag())
            domain.setAccount_purchase_tax_id(model.getAccount_purchase_tax_id());
        if(model.getChart_template_idDirtyFlag())
            domain.setChart_template_id(model.getChart_template_id());
        if(model.getAccount_sale_tax_idDirtyFlag())
            domain.setAccount_sale_tax_id(model.getAccount_sale_tax_id());
        if(model.getTax_cash_basis_journal_idDirtyFlag())
            domain.setTax_cash_basis_journal_id(model.getTax_cash_basis_journal_id());
        if(model.getProperty_stock_account_input_categ_idDirtyFlag())
            domain.setProperty_stock_account_input_categ_id(model.getProperty_stock_account_input_categ_id());
        if(model.getPartner_idDirtyFlag())
            domain.setPartner_id(model.getPartner_id());
        if(model.getIncoterm_idDirtyFlag())
            domain.setIncoterm_id(model.getIncoterm_id());
        if(model.getResource_calendar_idDirtyFlag())
            domain.setResource_calendar_id(model.getResource_calendar_id());
        if(model.getTransfer_account_idDirtyFlag())
            domain.setTransfer_account_id(model.getTransfer_account_id());
        if(model.getCurrency_exchange_journal_idDirtyFlag())
            domain.setCurrency_exchange_journal_id(model.getCurrency_exchange_journal_id());
        return domain ;
    }


}
